package messages;

public class ReturnAvailabilityMessage extends Message {
	
	private String username;
	private String availability;
	
	public ReturnAvailabilityMessage()
	{
		super("ReturnAvailability");
		this.username = "";
		this.availability = "";
			
	}
	
	public ReturnAvailabilityMessage(String type, String username, String availability)
	{
		super("ReturnAvailability");
		this.username = username;
		this.availability = availability;
	}
	
	public void setAvailability(String availability)
	{
		this.availability = availability; 
	}
	
	public String getAvailability()
	{
		return this.availability;
	}
	
	public void setUsername(String username)
	{
		this.username = username;
	}
	
	public String getUsername()
	{
		return this.getUsername();
	}
	
	public String toXML()
	{
		String message = "<message>";
        message += "<type>UpdateAvailability</type>";
        message += "<user><username>" + username + "</username></user>";
        message += "<availability>" + availability + "</availability>";
        message += "</message>";
        
        return message;
	}
}
